#define _CRT_SECURE_NO_WARNINGS
struct ListNode* oddEvenList(struct ListNode* head) {
    // write code here
    if (!head || !head->next || !head->next->next)
    {
        return head;
    }

    struct ListNode* s = head;
    struct ListNode* d = head->next;
    struct ListNode* dhead = d;

    while (s && d) {
        s->next = d->next;
        if (!s->next)
        {
            break;
        }
        s = s->next;
        d->next = s->next;
        d = d->next;
    }
    s->next = dhead;
    return head;

}